home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 007 / datescrn.arc / SET_DATE.C < prev    next >
Encoding:
Text File  |  1985-12-12  |  896 b   |  37 lines

  1. /*  set_date()  */
  2. /*  This function performs a system function call to set the system */
  3. /*  date with the parameters passed.  */
  4.  
  5. set_date(month, day, year)
  6. int month, day, year;
  7.           
  8. #define SET_DATE  0x2B
  9. #define byte char
  10. #define ONE   1
  11. #define TWO   2
  12. #define THREE 3
  13. #define FOUR  4
  14. #define FIVE  5
  15. #define SIX   6
  16. #define SEVEN 7
  17.  
  18. {
  19.  
  20.      int hold_yr;
  21.      struct  XREG {short ax, bx, cx, dx, si, di;};
  22.      struct  HREG {byte  al, ah, bl, bh, cl, ch, dl, dh;};
  23.      union   REGS {
  24.                struct  XREG x;
  25.                struct  HREG h;
  26.      } inregs, outregs;
  27.  
  28.      inregs.h.dl = day;
  29.      inregs.h.dh = month;
  30.      inregs.x.cx = year + 1900;
  31.      
  32.      inregs.h.ah = SET_DATE;
  33.      inregs.h.al = 0;
  34.      intdos(&inregs, &outregs);
  35.      
  36. }
  37.